package com.shiguiwu.springmybatis.designpattern.composite;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @description: 文件
 * @author: stone
 * @date: Created by 2021/2/25 23:00
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.designpattern.composite
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class File extends Catalog {

    private String name;

    private String type;

    private Double size;

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public String getType() {
        return this.type;
    }

    @Override
    public Double getSize() {
        return this.size;
    }

    @Override
    public void print() {
        System.out.println(String.format("文件的名称为%s,大小是%s",name,size));
    }
}
